home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Mac Power 1997 December
/
MACPOWER-1997-12.ISO.7z
/
MACPOWER-1997-12.ISO
/
AMUG
/
PROGRAMMING
/
Raven 1.2.sit
/
Raven 1.2
/
Documents
/
Change History
< prev
next >
Wrap
Text File
|
1997-09-08
|
23KB
|
383 lines
// ===================================================================================
// Raven 1.2 September 8, 1997
// ===================================================================================
Known Bugs:
・ハStack crawl doesn't have symbol names if virtual memory is on.
・ TStaticText now uses the Appearance Manager if it's installed. Unfortunately
it's ignoring the foreColor in the ControlFontStyleRec record and appears to
always use black (even though Appearance.h says that it should work).
General Notes:
・ハSince CW Pro now allows you to precompile the standard C++ headers the sample
projects set PRECOMPILE_RAVEN_HEADERS to 1. However in trying this I experienced
problems stepping into template code that was precompiled...
・ Raven has been updated to work with the Appearance Manager. This means you'll
have to weak link to ApperanceLib (if the Appearance Manager isn't installed
Raven will fall back to a System 7 implementation).
・ There have been a lot of changes to Raven. I think all the major changes are
mentioned below, but it's possible I missed a few.
Bug Fixes and Design Changes:
・ハIn an effort to be more compatible with STL and to reduce the neccesity to cast
when warn_implicitconv is on I've moved towards using ulong instead of short or
long in the interfaces.
・ハRaven no longer uses 'STR#' resources to look up strings. Instead Raven provides
LoadRavenString and LoadAppString functions that look up hard coded strings in
a table. For example, instead of something like LoadIndString(256, 5) you would
write LoadAppString("Foo"). LoadAppString would look up "Foo" in a 'StrM' resource
with id 256 and if "Foo" is in the resource a replacement string would be returned.
・ TDocument::HandleSaveAs returns false if there was an error. This way CanClose
will return false giving the user an opportunity to save to a different drive or
to not save at all.
・ハTWindow::Invariant no longer objects when clicking in title bar of collapsed window.
・ TToolWindow wasn't properly saving the visible flag when it was closed (so tool
windows were always visible when the app was re-launched). This has been fixed.
・ハIn Raven 1.1 a pane's active attribute worked like the visible attribute: if the
window was active a subpane could be active or inactive. If the window was inactive
all of its subpanes were also inactive. Since this doesn't seem to make much sense
and gave me problems I've changed the semantics so that panes are always active if
the window is active and always inactive when the window is inactive.
・ハThe applicable pane classes now support the Appearance Manager. This has entailed
some changes:
* Group box no longer supports colors other than gray. Secondary group boxes are
now supported.
*ハTDisclosureArrow no longer supports medium or large sizes.
*ハRenamed TCaption TStaticText. Added Enable and Disable methods.
・ TScroller::OnActivating and OnDeactivating call the Inherited method.
・ TScroller ctors created horz scrollbar if hasVertBar and vice versa.
・ TScrollBar uses the original mouse position when deciding where in the scroll box
the user clicked. This way the code works properly on slow machines with fast mousers.
・ Fixed for loop bug in TBaseTableView::GetCellFromPt.
・ハTControl has members holding the help text for the checked and disabled states. In
earlier versions these were always used. Now TControl::OnGetBalloonHelp uses TPane's
help text if TControl's text is empty.
・ハTAdorner uses mIndent instead of GetExtent overrides. The GetExtent override didn't
work because TPane overrode RemoveAdorner and called GetExtent to determine how much
to invalidate. Unfortunately RemoveAdorner was called by the TAdorner dtor which
meant the subclasse's GetExtent was no longer called.
・ハIn Raven 1.1 TTracker did not always call OnTrackContinue. Raven 1.2, on the other
hand, always calls OnTrackContinue at least once. This means that OnTrackStart
should be used only for initialization, OnTrackContinue should perform the action,
and OnTrackStop should handle cleanup.
・ TRubberBandTracker no longer caches canvas (didn't work when the view auto
scrolled).
・ハThe TMenu(short, string) ctor was designed to allow you to build menus by hand.
However versions of Raven prior to 1.2 neglected to allocate mMenuCommands which
lead to a crash in short order.
・ハIn Raven 1.1 TFile::Close was documented to not throw an exception and the dtor
called Close. This was done to make it easier to write exception safe code. For
example:
{
TFile file(spec);
file.Open(fsWrPerm);
file.Write(buffer.GetPtr(), buffer.GetSize());
}
If the write failed the file would automatically be closed and because Close
didn't throw we wouldn't have to worry about an exception being thrown while
the stack was being unwound. However because the File Manager buffers writes
FSClose has to flush the buffer which means FSClose may very well fail. To
handle this case Close now throws an exception. The dtor now ASSERTs that the
file is closed and calls Close is it's not (if an exception was thrown you'll
get an ASSERT but the file will be properly closed). The dtor also traps
exceptions. The above code should now be written as:
{
TFile file(spec);
file.Open(fsWrPerm);
file.Write(buffer.GetPtr(), buffer.GetSize());
file.Close();
}
・ FlushVolume throws instead of ASSERTing.
・ TFileSpec and TFolderSpec ctors that resolve aliases no longer throw if the
target doesn't exist.
・ TFileSpec and TFolderSpec ctors that take strings no longer automatically convert
the string to a valid file name (by replacing colons with dashes and truncating to
31 characters). Instead they ASSERT that the string is valid and, if it's not,
fix it up.
・ MTimer::StartTimer resets mSnapshot (so freq msecs elapse before OnTime is called).
Added MTimer::ResumeTimer (which works like StartTimer used to).
・ハMBroadcaster::Broadcast used to stuff the message into a member before sending it.
This was pretty gross, but it made it possible for the non-template MBaseBroadcaster
base class to do all the heavy lifting. Unfortunately this caused problems when a
broadcast caused a broadcast. This code has been rewritten to be a bit cleaner and
to fix this problem.
・ハThe code in ZDisplays.cpp has been revised using the RequestVideo sample code from
Apple. New functions have been added to get and restore the state of a device. The
state includes the Display Manager cookies so it now restores the device to the
exact old state. Also SetDisplayMode now picks the highest refresh rate.
・ Fixed an ASSERT in TMemoryHeap::AddAllocator.
・ TSimpleAllocator adjust heap size when allocating huge blocks.
・ TRect and TLongRect Pin methods pin to botRight instead of botRight minus one.
・ハTLongRect::MapTo uses longs instead of shorts.
・ Fixed a bad bug in TQueue::DoExpandBuffer.
・ TSetPort no longer crashes if current port is bogus.
Changes:
・ハHAS_EXPLICIT and HAS_MUTABLE in RavenHeader.h now default to true (for CW Pro1).
・ RavenHeader.h includes ansi_parms.h
・ Added ENABLE_IMPLICIT_CONV_WARNING macro. This is off by default. If you turn
it on ZTypes.h enables the warn_implicitconv warning in the 1.9 compiler. Note
that there are parts of Raven that have not been compiled with this on.
・ TApplication::OnCreateDebugCommander is called after OnInit (so the Debug menu
appears after the Windows menu).
・ Add a command to the debug menu to show/hide pane invalidations.
・ Made some changes to TDocApplication:
* If the option key is down the close command becomes close all and the save
command becomes save all. If the command key is down the close command becomes
junk all.
* Added support for the OS 8 'rapp' apple event.
* Renamed GetFile OnGetFile.
・ Made some changes to TDocument:
* HandleSave and HandleSaveAs delete the file if there was an error writing it
out.
* SetDirty and HandleSetDirty now take a data argument (which defaults to nil).
This is broadcast along with the kChangedDocument message.
* HandleSaveAs won't save over files whose type is not mFileType.
* Volume is flushed after saving.
* SDocumentMessage::document is now a const TDocument pointer.
・ Added TDocWindow::Create.
・ Made some changes to TWindow:
* mLatentTarget no longer has to be a subpane.
* Removed OnSelect. (This was never called and never made much sense).
* Implemented auto-positioning.
・ Added support for opaque panes. A pane is opaque if it's visible and has an opaque
adorner (eg TEraseAdorner) or the mOpaque member is set. TView::HandleDraw clips
any opaque subpanes before drawing itself. This can significantly reduce flashing.
・ TView::OnSubPaneScrolled, OnSubPaneChangedSize, and OnSubPaneChangedLocation
now have a redraw argument.
・ Added TScroller::mEraseOnUpdate.
・ TStringListBox broadcasts when selection changes or user double clicks.
・ Worked on TBaseTableView:
* Made GetRowHeight and GetColWidth public. Made mNumCols and mRows protected.
* Added support for selections.
* Added ScrollIntoView.
* Replaced OnMouseDownCell with OnDoubleClickCell.
* Added TTableSelection, TRowSelection, and TCellSelection.
・ Tweaked scroll bar positioning in TListBoxBase. OnMouseDown handles click after
switching target. AdjustScrollBar calls SetPageDelta.
・ハChanged TScrollableView overhang reconciliation to reduce flashing.
・ハTCheckBox and TRadioButton support mixed state.
・ Added context menus to TColorSwatch.
・ DoNote, DoCaution, and DoStop use StandardAlert if it's available. (They also take
a second string).
・ TMenuBar uses MenuEvent instead of MenuKey (if Appearance Manager).
・ TMenuBar::GetCommandFromKey and DefaultFilterProc use IsCommandPeriod() (which works
with non-US keyboards).
・ Removed SCommandStatus::usesMark.
・ハTContextMenu uses Context Menu Manager if it's installed.
・ Added TDragSession::SetClippingPrefix and SetClippingName (which are used by
the OS 8 Finder).
・ Made some undo related changes:
* Removed transaction support from TUndoMgr. Added TMultipleUndoableCommand.
*ハRemoved Abort methods from TUndoableCommand.
*ハAdded TUndoableCommand::IsValid. Subclasses can override this and return false
when they can no longer do anything useful (TSafePtr (see below) can help with
this).
* TUndoMgr has been updated to delete invalid commands.
・ハTTracker::OnTrackStop now only has a stopPt argument.
・ TStdScoreDeviceFn gives modes at the current resolution a slightly higher score
(this is useful when your app doesn't care what resolution it runs at).
・ FindPreferredDevice short cuts search if current mode suffices.
・ TSetPort (GrafPtr) ctor now takes an optional GDHandle.
・ Added TColorTable(PaletteHandle).
・ハAdded TPicture::Write. Added a ctor to create a picture from a TGWorld.
・ Made some changes to streaming code:
* TOutHandleStream ctor allows clients to specify a reserve size.
* operator>>(TInStream, double) byte swaps if neccesary.
* Added stream operators for vector, list, map, and set.
* Added streaming operators to TQueue.
・ Added UFileSystem::SpecExists and IsValidName.
・ UFileSystem::GetUniqueFile uses SpecExists instead of FileExists.
・ハTFolderSpec::GetTempFolder and GetTrashFolder allow you to optionally specify a
volume.
・ Added assembly glue allowing float to string functions to work with long doubles.
・ハTRegularExpression has been reimplemented using finite automata. This makes matching
much faster but constructing the TRegularExpression object may take a bit longer.
・ Renamed EqualReal Equal.
・ Abs() functions use intrinsics on PPC.
・ Made TVector a template class. Added operator*(T, TVector).
・ TPoint and TLongPoint operator <, <=, >, and >= check v first. This way points
can be sorted so that the topLeft points are first and botRight are last.
・ Added TPoint and TLongPoint Distance friend functions.
・ PRECONDITION macro casts 'this' to an MInvariant*. This allows the PRECONDITION
and POSTCONDITION macros to be used inside a mixin.
・ MBaseEditableObject, MBehaviorableBase, MCommander, and MLockable use PRECONDITION
and POSTCONDITION macros.
・ Added non-virtual Invariant to MCommander.
・ Added an Invariant to ZHandleRef. OnLock now adds a tail to the handle.
・ Added ulong versions of all the int conversion functions (in ZIntConversions.h).
・ハTAppBootStrap::OnInitSioux now always puts SIOUX on the main monitor
・ TSystemException and ThrowIfOSErr use OSStatus instead of OSErr. (Some of the
newer manager return OSStatus. Since this is a long there's a chance of data
loss when using OSErr).
・ Added kActivatingWindow and kDeactivatingWindow to TStateBroadcaster.
・ Made some changes to the Skeleton project:
* Rewrote Skeleton.r Edit menu balloon help.
* Added a 68K stub to Skeleton project. (This is a tiny 68K app that tells the
user that he need a PPC to run the app).
* Created Debug, Release, and Profile targets in the Skeleton project.
・ TMemoryHeap block count functions are defined if !RELEASE (instead of if DEBUG).
・ Added TMemoryHeap::DumpCommonBlocks and DumpAllocatorCapacities. You can use these
to determine if the fixed allocators you're using are still OK in builds (to do
this build a !DEBUG and !RELEASE version of your app and call DumpCommonBlocks and
DumpAllocatorCapacities at the end of main).
・ハTProfiler uses bestTimeBase instead of microsecondsTimeBase. (This will cause
PPCTimeBase to be used on a PPC which yields much less of a speed hit than
microsecondsTimeBase).
・ TProfiler warning for too small numFunctions and stackDepth now reports correct
required values.
Additions:
・ハAdded SGI STL to Extras. Unlike the MSL in CW Pro1 this library is exception
safe and includes extensive debugging support. It also produces smaller
executables.
・ Added ZDialogBoxes.h and cpp which contain functions that make it very easy to
handle simple Quill style input dialogs.
・ Added TPatternSwatch. When this is clicked it pops up a menu that allows the user
to pick one of the standard patterns.
・ Added TPopupTable. This is a TSimpleTableView that functions like a popup menu.
TPatternSwatch uses this to popup the pattern menu.
・ Added TVisualSeparator. This is a simple divider line that works correctly with
the Appearance Manager.
・ Added TPicturePane.
・ Added TStandardGetFile, TStandardGetFileOrFolder, and TStandardPutFile. These
provide a framework for easily extending a custom standard file dialog with
filter and hook functions.
・ Added an Automata folder to Esoterica. This contains deterministic and non-
deterministic finite automata classes.
・ Brand new parser classes have been added to Esoterica:Parser. These classes provide
a powerful framework for implementing recursive descent parsers. (The old TParser
class has been renamed TSimpleParser and can still be useful for simple jobs).
・ハAdded THSVColor.
・ Added a templatized 2D array called TArray. (This is a generic array, if you're
storing floats you probably want to use TMatrix).
・ Added a sparse templatized 2D array called TSparseArray.
・ Added TSet. This is a wrapper around STL's set class that behaves more like a set
in mathematics. For example you can get the intersection of two sets by typing
s1 & s2 and you can add a new element with s1 += elem.
・ Added TSafePtr. This is a smart pointer class that gets notified when its target
is destroyed. You can check to see if the pointer is OK to use by calling the
TargetExists method.
・ Added a template TComplex class. This is similar to the standard's complex class
except that it provides direct access to the real and imaginary members.
・ Added xdouble. This is the long double class from the LiDIA math package.
・ Added int and double versions of Random.
// ===================================================================================
// Raven 1.1 Apr 16, 1997?
// ===================================================================================
Known Bugs:
・ハStack crawl doesn't have symbol names if virtual memory is on.
Bug Fixes and Design Changes:
・ In Raven 1.0 the PRECONDITION and POSTCONDITION macros looked like this:
#define PRECONDITION(x) this->Invariant(); ASSERT(x)
#define POSTCONDITION(x) this->Invariant(); ASSERT(x)
This was nice and simple, but caused problems because the Invariant should only
be called from within public methods (because the invariants may temporarily become
invalid in a protected method). I tried to handle this by only calling protected
methods from protected methods, but this isn't always feasible. So, I wound up
removing the invariant checks from some public methods. Raven 1.1 handles this
using a new MInvariant mixin and a new stack based class:
#define PRECONDITION(x) ASSERT(x); ZCheckInvariant _check(this)
#define POSTCONDITION(x) ASSERT(x)
ZCheckInvariant is a stack based class that increments an MInvariants nesting
level and calls the Invariant method if the nesting level is one. By doing this
the Invariant function is only called at the start and end of the original public
method. This has the following implications:
1) You need to descend from MInvariant if you want to use PRECONDITION and
POSTCONDITION.
2) You can only call PRECONDITION once per method.
3) You shouldn't call PRECONDITION in a dtor (since the invariant doesn't
usually hold when the dtor exits).
・ハTDocument::HandleClose was added before documents were ref counted and didn't
work correctly with TDocWindows (the document was deleted but the doc window wasn't
and wound up with a dangling pointer to the doc). Because documents are
supposed to be deleted when their ref count goes to zero HandleClose has been
removed. If you absolutely must close a document you can use the new ForceClose
method which broadcasts kForceCloseDocument to the doc's listeners so that they
can close themselves and thereby decrement the doc's ref count to zero. (This
fixes a crash when an exception was thrown while a document was opening).
・ハThe startOnPreferred flag in TWindow wasn't working correctly when windows were
reanimated. This has been fixed by adding TWindow::ForceOnPreferred and overriding
OnReanimated to call ForceOnPreferred.
・ Mouse events now bubble down to the correct pane; got rid of Dispatch methods
in TWindow.
・ TCodeTimer and TAverageTimer use the Time Manager to compute an elapsed time in
microseconds. Unfortunately the toolbox doesn't cleanup Time Manager tasks when
an app exits. So, if you terminated the app via ExitToShell or the debugger while
a TCodeTimer or TAverageTimer object was alive you'd get a crash. To fix this these
classes now descend from the new MExitAction class.
・ TWindow only draws size box when the window is active.
・ TFileIterator resolves aliases.
・ T2DGraph invalidates when plots are added or removed.
・ Fixed a bug in TRegularExpression involving consectutive expressions using '*'.
・ハLots of small fixes to TBaseTableView and TSimpleTableView.
・ Made TRect::Pin const.
Changes:
・ RavenHeader.h defines __dest_os and __MSL_LONGLONG_SUPPORT__.
・ If !DEBUG && ASSERTS_THROW PRECONDITION and POSTCONDITION map to ASSERT (instead
of no-ops).
・ハTApplication::Run handles update events without calling WNE.
・ Most of Raven's iterator classes have been made STL compliant: this includes
TWindowIterator, TSubPaneIterator, TFileIterator, and TVolumeIterator.
・ Got rid of kOpeningDocument, kClosingDocument, kSavingDocument, and
kRevertingDocument document messages.
・ Renamed OnBalloonHelp OnGetBalloonHelp. HandleBalloonHelp no longer has a
THelpMessage argument.
・ T2DGraph supports dragging and the copy command.
・ Changed TWindow:
* Moved IsDoubleClick and IsRightClick from TPane to TWindow.
* Added OnStagger.
・ Got rid of TScale class (T2DAxis uses new TTransform class).
・ Worked on regular expressions:
* Added support for '?' and '|' characters.
* Added constants for some common regular expressions.
・ TBootStrap dtor no longer calls __destroy_global_chain (because MSL C++ 2.1.1
calls it for us).
・ Added TMenu::SetCommandKey.
・ Changed geometry classes:
* Added <, <=, >, and >= operators to TPoint.
* Added TRect::SetHeight and SetWidth.
・ハUCursorUtils::StillBusy only tickles cursor if more than a tick has elapsed
since the last tickle.
・ MTimeMgrTimer descends from MExitAction instead of using an ExitToShell patch.
・ Added GetResourceInfo to ZResUtils.h
・ Added GetRefNum to TOpenResFile.
・ TemporaryZone() no longer caches zone.
・ TDebugMenuMgr enables copy and select all commands if SIOUX window is frontmost.
・ハTMemoryHeap::Deallocate validates the block before instead of after zapping.
・ Added virtualMemIsOn to UGestalt.
・ Added GetWorld to TGWorld.
・ハAdded window functions to ZFourier.h
・ ComputeSpectrum uses averaging to get better results.
・ハAdded some additional TVector ctors.
・ Added STL style iterators to TVector.
・ Added a unit test to TFileIterator.
・ Changed zlib compression files:
* Added #pragma cplusplus off to all files.
* Enabled all optimizations in the all files.
* Trace macro now checks verbose flag (prevents inflate from spewing).
・ If the app doesn't have a prefs file the annoying TRACEFLOW categories are
disabled.
・ Removed kEmptyString, kEmptyPascalString, and kUnknownString.
Additions:
・ Added QuickDraw 3D wrapper classes (look at the BoxPaint example to see how these
work).
・ハAdded 3D graphing classes (see the new Caw example program).
・ Added specializations of STL's copy, copy_backward, and uninitialized_copy to ZTypes.h.
Also added specializations for geometry types and a few other classes.
・ Added a simple matrix class.
・ Added MExitAction for objects that need to cleanup when app exits abnormally.
// ===================================================================================
// Raven 1.0 Feb 23, 1997?
// ===================================================================================
・ First public release.